<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<% 
 /**
  功能名称:人员下的角色设置设置
  创建时间:2013-9-8
  创建人:闷男
**/
%>
<%
String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    
    <title>给${PNAME }授予权限</title>
	<link href="<%=path %>/css/index_css.css" rel="stylesheet" type="text/css" />
	<script src="<%=path%>/js/syAjax.js"></script>
	<script type="text/javascript">
        
        function showModel(roleId,type,obj){
        	var mode ="";
        	if(obj.innerHTML.indexOf('√')!=-1) {
        		mode="delete"
        	}else {
        		mode="save";
        	}
        	var callback = {fail:onFail,type:'plain'};
        	callback.success = function(resp) {
        		if(resp=="true") {
        			if(mode=="save") {
        				obj.innerHTML='√';
        			}else {
        				obj.innerHTML='';
        			}
        		}
        	};
        	syAjax.request("post","<%=path%>/checkUserRoleroleAction.action","type="+type+"&user.userId=${user.userId}&mode="+mode+"&role.roleId="+roleId+"&t="+new Date(),callback);
        }
        function toRoleUser() {
        	
        	window.location.href ="<%=path%>/toRoleUserSetroleAction.action?ttt="+new Date();
        }
	</script>

  </head>
  
 <body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td colspan="2" align="left" class="f_5" height="35px">给${PNAME }授予权限</td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#9DD12E"></td>
  </tr>
    <tr height="25">
  	<td ><input type="button" style="height:20px;display: block;vertical-align: bottom;background-color:#B8C9DB;" value="按角色赋予权限" onclick="toRoleUser()"/></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top" class="border_2"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DCDCDC">
      <tr>
        <td width="14%" height="30" align="left" bgcolor="#DBE9F6" class="f_4">&nbsp;角色名称</td>
        <td width="86%" align="left" bgcolor="#DBE9F6" class="f_4">&nbsp;打勾授予该项权利 </td>
        </tr>
        <c:if test="${user.account !='admin'}">

         	<tr>
	        <td height="50" bgcolor="#FFFFFF" class="f_4">&nbsp;学校系统管理员</td>
	        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#FFFFFF'" onclick="showModel('sysadmin','roleType',this);">
	   				${ROLEMAP.sysadmin}
	        </td>
	      </tr>

      </c:if>


      <tr>
        <td height="50" bgcolor="#F2F5FA" class="f_4">&nbsp;校长等领导</td>
        <td align="left" bgcolor="#F2F5FA" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('xzadmin','roleType',this);">
    	${ROLEMAP.xzadmin}
        </td>
       </tr>

        <c:if test="${applicationScope.shiyue1 eq 'true'}">
      <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4">&nbsp;办公管理员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#FFFFFF'" onclick="showModel('gwadmin','roleType',this);">
        ${ROLEMAP.gwadmin}
        </td>
        </tr>
        </c:if>
        <c:if test="${applicationScope.shiyue2 eq 'true'}">
      <tr>
        <td height="50" bgcolor="#F2F5FA" class="f_4">&nbsp;学籍管理员</td>
        <td align="left" bgcolor="#F2F5FA" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('xjadmin','roleType',this);">
 			${ROLEMAP.xjadmin}
        </td>
        </tr>
        </c:if>
        <c:if test="${applicationScope.shiyue3 eq 'true'}">
      <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4">&nbsp;人事管理员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#FFFFFF'" onclick="showModel('rsadmin','roleType',this);">
			${ROLEMAP.rsadmin}
        </td>
      </tr>
      </c:if>
      <c:if test="${applicationScope.shiyue4 eq 'true'}">
      <tr>
        <td height="50" bgcolor="#F2F5FA" class="f_4">&nbsp;校产管理员</td>
        <td align="left" bgcolor="#F2F5FA" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('xcadmin','roleType',this);">
				${ROLEMAP.xcadmin}
        </td>
      </tr>
      </c:if>
      <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4">&nbsp;教务管理员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#FFFFFF'" onclick="showModel('jwadmin','roleType',this);">
			${ROLEMAP.jwadmin}
        </td>
      </tr>
      <c:if test="${applicationScope.shiyue6 eq 'true'}">
      <tr>
        <td height="50" bgcolor="#F2F5FA" class="f_4" nowrap="nowrap">&nbsp;学业评价管理员</td>
        <td align="left" bgcolor="#F2F5FA" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('markadmin','roleType',this);">
        	${ROLEMAP.markadmin}
        </td>
      </tr>
      </c:if>
      <c:if test="${applicationScope.shiyue9 eq 'true'}">
      <tr>
        <td height="50" bgcolor="#F2F5FA" class="f_4" nowrap="nowrap">&nbsp;课堂教学管理员</td>
        <td align="left" bgcolor="#F2F5FA" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('zyadmin','roleType',this);">
			${ROLEMAP.zyadmin}
        </td>
      </tr>
      </c:if>
        <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4" nowrap="nowrap">&nbsp;文印管理员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('wyadmin','roleType',this);">
			${ROLEMAP.wyadmin}
        </td>
      </tr>
       <tr>
        <td height="50" bgcolor="#F2F5FA" class="f_4" nowrap="nowrap">&nbsp;报修管理员</td>
        <td align="left" bgcolor="#F2F5FA" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('bxadmin','roleType',this);">
        	${ROLEMAP.bxadmin}
        </td>
      </tr>
      
      <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4" nowrap="nowrap">&nbsp;论坛管理员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('ltadmin','roleType',this);">
         	${ROLEMAP.ltadmin}
        </td>
      </tr>
      
       <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4" nowrap="nowrap">&nbsp;财务管理员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('cwadmin','roleType',this);">
         	${ROLEMAP.cwadmin}
        </td>
      </tr>
      
      <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4" nowrap="nowrap">&nbsp;教师档案袋管理员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('dadadmin','roleType',this);">
         	${ROLEMAP.dadadmin}
        </td>
      </tr>
 
 	  <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4" nowrap="nowrap">&nbsp;门户管理员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('portaladmin','roleType',this);">
         	${ROLEMAP.portaladmin}
        </td>
      </tr>
      
      <tr>
        <td height="50" bgcolor="#FFFFFF" class="f_4" nowrap="nowrap">&nbsp;物品采购员</td>
        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#F2F5FA'" onclick="showModel('wpcgadmin','roleType',this);">
         	${ROLEMAP.wpcgadmin}
        </td>
      </tr>
      
    </table></td>
  </tr>
  
 
  
 
  
  
  <tr>
    <td colspan="2" align="left">&nbsp;</td>
  </tr>
  
  <!-- ---------***** -->
    <tr>
    <td colspan="2" align="left" class="f_5">邮件授权</td>
  </tr>
  <tr>
    <td height="1" colspan="2" bgcolor="#9DD12E"></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top" class="border_2"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DCDCDC">
      <tr>
        <td width="14%" height="30" align="left" bgcolor="#DBE9F6" class="f_4">&nbsp;邮件消息类别</td>
        <td width="86%" align="left" bgcolor="#DBE9F6" class="f_4">&nbsp;姓名 </td>
        </tr>
        
      <c:if test="${not empty requestScope.CODELIST}">  
      <c:forEach var="c" items="${requestScope.CODELIST}" >
      	<c:set var="idx" value="s${c.value}"></c:set>
	      <tr>
	        <td height="50" bgcolor="#FFFFFF" class="f_4">&nbsp;${c.name }</td>
	        <td align="left" bgcolor="#FFFFFF" style="cursor:pointer;" onmouseover="this.style.backgroundColor='#E4F5FF'" onmouseout="this.style.backgroundColor='#FFFFFF'" onclick="showModel('${c.value}','docType',this);">
	       	${DOCMAP[idx] }
	        </td>
	        </tr>
        </c:forEach>
     </c:if>
    
    
    
   
     
     
    </table></td>
  </tr>
    <c:if test="${from!='role'}">
  <tr>
    <td colspan="2" align="center">&nbsp;<input type="button" value="关 闭" onclick="javascript:window.close();"/></td>
  </tr>
  </c:if>
</table>
</body>
</html>
